//
//  CustomCell.m
//  CustomCell
//
//  Created by apple on 2017/3/12.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "CustomCell.h"

@interface CustomCell() 

@end

@implementation CustomCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)configCell:(NSDictionary *)dic
{
    NSString *title = [NSString stringWithFormat:@"this is no %ld",self.tag];
    [self.myButton setTitle:title forState:UIControlStateNormal];
    self.myLabel.text =dic[@"name"];
    //cell.myLabel.text =@"test";
    NSString *imageFile = dic[@"image"];
    self.myImageView.image = [UIImage imageNamed:imageFile];
    //self.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}

- (IBAction)clickButton:(id)sender {
    NSString *title = [NSString stringWithFormat:@"this is no %ld",self.tag];
    
    _myLabel.text = title;
    if ([_delegate respondsToSelector:@selector(sendValue:)])
    { // 如果协议响应了sendValue:方法
        [_delegate sendValue:title]; // 通知执行协议方法
    }

}




@end
